package com.TestDemo.Test1;

public class TestThrow {


    public static void main(String[] args) {
        try {
            System.out.println("aaa"); // go
            try{
                System.out.println("bbb"); // go
                throw new Exception("<<<"); // to catch
            }catch (Exception e){
//                throw new Exception(">>>");
                System.out.println("ccc"); // go
                System.out.println(1/0);  // to finally
                System.out.println("2ccc"); // no out
                e.printStackTrace(); // no out
            }finally {
//                throw new Exception(">>>");
                System.out.println("内finally"); //go
                System.out.println(1/0);  //  exit now try{}catch(){}finally{}
                System.out.println("内2finally"); // no out
            }
//            throw new Exception(">>>");
//            System.out.println("a");  // 之前手动异常,无法书写，编译报错
            System.out.println(1/0); // to catch
            System.out.println("a"); // no out
        } catch (Exception e) {
            System.out.println("eee");  // go
            e.printStackTrace(); // print

        }finally {
            System.out.println("外finally"); // out && exit
        }
    }




}
